package lab02.test22;

public class Test22 {
    public static void main(String[] args) {
        String result = "HEllO,world,2017";

        for (int i = 0; i < result.length(); i++) {
            char tmp = result.charAt(i);

            //把所有大写字母变成小写字母
            if (tmp >= 'A' && tmp <= 'Z') {
                System.out.print((char) (tmp + 32));
            }

            //小写字母不变
            else if (tmp >= 'a' && tmp <= 'z') {
                System.out.print(tmp);
            }

            //数字用0代替
            else if (tmp >= '0' && tmp <= '9') {
                System.out.print("0");
            }

            //其他符号用#代替
            else {
                System.out.print("#");
            }
        }
    }

}

